import java.util.Arrays;
import java.util.Scanner;

//public class Test1 {
    /*public static void hello(){
        System.out.println("hello");
    }*/
    /*public static void main(String[] args) {

        //System.out.println(s);此处会报错，因为必须初始化
    }*/


    /*public static void main(String[] args) {
        int[] n = {1 , 2 , 4 , 2 , 4};
        System.out.println(arr(n));


    }
    public static boolean arr(int[] n){
        for (int i = 1; i < n.length - 1; i++) {
            if(n[i] % 2 != 0 && n[i-1] % 2 != 0 && n[i+1] % 2 != 0)
            {
                return true;
            }
        }
        return false;

    }*/
    //只出现一次的数字
    /*public static void main(String[] args) {
        int[] n = {4 , 1 , 2 , 2 , 4 , 4 , 4};
        System.out.println(num(n));


    }
    //给定一个大小为n的数组，找到其中的多数元素
    public static int num(int[] n){
        Arrays.sort(n);
        return n[n.length / 2];
    }*/

    /*public static int num(int[] n){
        int result = 0;
        for (int x:n
             ) {
            result ^= x;
        }
        return result;
    }*/

//}
/*class MyApplication {
    public static void main(String[] args) {
        Test1 test = null;
        test.hello();
    }
}*/
//public class Test1 {

    /*static boolean Paddy = true;

    public static void main(String[] args) {
        System.out.println(Paddy);
    }*/
    /*String name;
    int age;
    String work;

    public Test1( int age, String work) {
        this.age = age;
        this.work = work;
    }

    public Test1(String name) {

        this.name = name;
    }*/
    /*public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNextInt()) {
            int x = scanner.nextInt();
            int y = scanner.nextInt();
            Data data = new Data(x, y);
            System.out.println(data.getX() + data.getY());
        }
    }

}*/

/*class Data {

    public int x;
    public int y;

    public Data(int x, int y) {
        this.x = x;
        this.y = y;
    }

    public int getX() {
        return x;
    }

    public int getY() {
        return y;
    }*/

//}
/*class Base {

    private int x;
    private int y;

    public Base(int x, int y) {
        this.x = x;
        this.y = y;
    }

    public int getX() {
        return x;
    }

    public int getY() {
        return y;
    }

}

class Sub extends Base {

    private int z;

    public Sub(int x, int y, int z) {
        super(x, y);
        this.z = z;
    }

    public int getZ() {
        return z;
    }

    public int calculate() {
        return super.getX() * super.getY() * this.getZ();
    }

}*/
/*public class Test1 {
    public String name;
    public String color;

    public Test1(String name, String color) {
        this.name = name;
        this.color = color;
    }

    public void barks(){
    System.out.println(name + "汪汪汪");
}
public void wag(){
    System.out.println(name + "摇尾巴");
}

    public static void main(String[] args) {
        Test1 dog = new Test1("旺财" , "黄色");
        dog.barks();
        dog.wag();

    }
}
class Date {
    public static int year = 1500;
    public int month;
    public int day;

    public Date(int year, int month, int day) {
        this.year = year;
        this.month = month;
        this.day = day;
    }
    public Date(){
        this(1900 , 2 , 25);
    }
    public void printDate(){
        System.out.println(year + "-" + month + "-" + day);
    }

    public static void main(String[] args) {
        Date d = new Date(2022 , 3 , 25);
        d.printDate();
        Date date = new Date();
        date.printDate();
        d.printDate();



    }
}*/
//public class Test1 {

    /*public static void main(String[] args) {
        Box<Integer> integerBox = new Box<>();
        integerBox.setValue(10);
        int value = integerBox.getValue();
    }*/
    /*public static void main(String[] args) {
        *//*Test1 test = null;
        test.hello();*//*
        Test1 test = new Test1();
        System.out.println(test);


    }
    public String toString(){
        System.out.print("aaa");
        return "bbb";
    }
    public static void hello(){
        System.out.println("hello");

    }*/

/*class Box<T>{ //泛型类，在定义时在类名后面加<T>
    private T value;


    public void setValue(T value){
        this.value = value;
    }
    public T getValue(){
        return value;
}
}*/

class Animal{
    String name;
    int age;

    public Animal(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public void eat(){
        System.out.println("正在吃饭");
    }

    public void sleep(){
        System.out.println("正在睡觉");
    }

}
class Dog extends Animal {
    public Dog(String name, int age) {
        super(name, age);
    }

    void bark(){
        System.out.println(name + "汪汪汪");
    }
}

class Cat extends Animal{
    String num;

    public Cat(String name, int age, String num) {
        super(name, age);
        this.num = num;
    }

    void mew(){
        System.out.println(name + "喵喵喵");
    }
}

public class Test1{
    public static void main(String[] args) {
        Dog dog = new Dog("小狗" , 10);
        System.out.println(dog.age);
        System.out.println(dog.name);
        dog.eat();
        dog.bark();
    }
}





